package com.meetingshow.privilege.dao;

import java.util.List;

import com.meetingshow.common.base.dao.BaseDAO;
import com.meetingshow.common.base.dao.model.QueryStruct;
import com.meetingshow.common.base.service.model.QueryResults;
import com.meetingshow.privilege.dao.model.PriUserFollowPO;

public class PriUserFollowDAO extends BaseDAO {
    public Integer savePriUserFollow(PriUserFollowPO priPriUserFollowPO) throws Exception {
        return (Integer) this.saveBaseObj(priPriUserFollowPO);
    }

    public void updatePriUserFollow(PriUserFollowPO priPriUserFollowPO) throws Exception {
        this.updateBaseObj(priPriUserFollowPO);
    }

    public void removePriUserFollow(PriUserFollowPO priPriUserFollowPO) throws Exception {
        this.deleteBaseObj(priPriUserFollowPO);
    }

    public QueryResults<PriUserFollowPO> queryPriUserFollow(QueryStruct queryStruct) throws Exception {
        QueryResults<PriUserFollowPO> queryResults = new QueryResults<PriUserFollowPO>();
        List<PriUserFollowPO> resultList = findByParameter(queryStruct);
        queryResults.setResultList(resultList);
        if (queryStruct.getFirstResultNo() != null
                && queryStruct.getResultsPerGroup() != null) {
            queryResults = queryPageInfo(queryStruct, queryResults);
        } else {
            queryResults.setTotalResultsNum(Long.valueOf(resultList.size()));
        }
        return queryResults;
    }
}
